﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="Wwtfly.BBS.ForeApplication.WebForm.Register" %>
<%@ Register Src="~/WebForm/Shared/Head.ascx" TagName="WebHead" TagPrefix="headtop" %>
<%@ Register Src="~/WebForm/Shared/Foot.ascx" TagName="WebFood" TagPrefix="foodup" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>酷乐彩注册</title>
    <link rel="stylesheet" type="text/css" href="css/style.css"/>
    <script src="Script/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="Script/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="Script/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="Script/md5.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
       <div class="contanter">
         <headtop:WebHead ID="head1"  runat="server"/>
        <div class="location Fleft">
            您现在的位置：<a href="#">登录酷乐彩！</a></div>
        <div class="bodyer Fleft MTop">
            <div class="body_left Fleft">
                <table border="0" cellspacing="0" cellpadding="0" class="warp_table">
                    <tr>
                        <td colspan="2" style="width: 30%;">
                            <div class="login">
                                快速注册</div>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            用户名：
                        </td>
                        <td>
                            <input type="text" name="tuserName" id="tuserName" class="input" />&nbsp;*&nbsp;<a id="chekUserName" href="javascript:void(0);">检验用户是否可用</a>&nbsp;&nbsp;<em
                                id="userName"></em>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            联系QQ：
                        </td>
                        <td>
                            <input type="text" name="tusersqq" id="tusersqq" class="input" />&nbsp;*&nbsp;<em
                                id="usersqq"></em>
                        </td>
                    </tr>
                      <tr>
                        <td align="right">
                            Email：
                        </td>
                        <td>
                            <input type="text" name="tusersEmail" id="tusersEmail" class="input" />&nbsp;*&nbsp;<em
                                id="usersEmail"></em>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            密&nbsp;&nbsp;码：
                        </td>
                        <td>
                            <input type="password" name="tuserpwd1" id="tuserpwd1" class="input" />&nbsp;*&nbsp;<em
                                id="userpwd1"></em>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            确认密码：
                        </td>
                        <td>
                            <input type="password" name="tuserpwd2" id="tuserpwd2" class="input" />&nbsp;*&nbsp;<em
                                id="userpwd2"></em>
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            验证码：
                        </td>
                        <td>

                            <input type="text" name="textCode" id="textCode" class="input" />&nbsp;&nbsp;<img
                                id="randImgCode" src="Controller/CheckCode.aspx" width="100" height="35" />&nbsp;&nbsp;<a
                                    href="javascript:void(0);"  onclick="Imgclick();">下一张</a>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <img alt="注册" id="Usersubmit" src="images/register.jpg" width="100" height="35" />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="font-size: 12px; text-align: center;">
                            <input name="year18" id="year18" checked="checked" value="yes" type="checkbox" />
                            <label for="year18">
                                我已经年满18岁并同意 <a href="#" target="_blank">《酷乐彩服务条款》</a>和 <a href="#" target="_blank">《酷乐彩拍服务条款》</a>。</label>
                            <br />
                            温馨提示：您注册的账号在酷乐彩彩票网和酷乐彩拍网均可使用。
                        </td>
                    </tr>
                </table>
            </div>
            <div class="body_right MLeft2 Fleft ">
                <div class="boder1 Ttitle_bg">
                    <span class="moReZt Fright">更多&gt;&gt;</span>
                    <h5>
                        玩法专题</h5>
                </div>
                <div class="Contentbox boder2">
                    <ul style="margin-top: 0 !important; padding-top: 12px;">
                        <li><a href="#">向东双色球2012016期：两蓝01 0320120</a></li>
                        <li><a href="#">田广双色球2012016期预测：胆</a></li>
                        <li><a href="#">向东双色球2012015期：两蓝05：金</a></li>
                        <li><a href="#">田广双色球2012015期预测：金7期预测：金胆</a></li>
                        <li><a href="#">调查:如何看待双色球2.6亿巨金胆</a></li>
                        <li><a href="#">双色球12014期头奖井喷59注520 期预测：</a></li>
                        <li><a href="#">田广双色球2012017期预测：金胆24：金胆</a></li>
                        <li><a href="#">向东双色球2012017期：两蓝03 1测：金胆</a></li>
                        <li><a href="#">向东双色球2012017期：两蓝期预测：金胆</a></li>
                        <div class="clear">
                        </div>
                    </ul>
                </div>
            </div>
        </div>
      
       <foodup:WebFood ID="food1"  runat="server"/>

    </div>
    </form>
    <script type="text/javascript">
        function Imgclick() {
            $("#randImgCode").attr("src", "Controller/CheckCode.aspx?remode=" + Math.floor(Math.random() * 10 + 1));
        }
        $(document).ready(function () {
            $("#chekUserName").click(function () {
                var username = $("#tuserName").val();
                if (username != "") {
                    $.post("ashx/UsersHandler.ashx",
                        { parms: "UserName_pmusers",
                            tuserName: username
                        }, function (result) {
                            if (result == "0") {
                                alert("用户名可以注册！");
                            } else {
                                alert("已被占用请重新输入！");
                            }
                        });
                } else {
                    alert("用户名不能为空！");
                }
            });
            $("#tuserName").blur(function () {

                var username = $(this).val();
                if (username == "") {
                    $("#userName").html("<b>用户名不能为空！</b>");
                } else {
                    $.post("ashx/UsersHandler.ashx",
                        { parms: "UserName_pmusers",
                            tuserName: username
                        }, function (result) {
                            if (result == "0") {

                                $("#userName").html("<small>用户名可以注册！</small>");
                            } else {
                                $("#userName").html("<small>已被占用请重新输入！</small>");
                            }
                        });
                }
            });
            $("#tusersqq").blur(function () {
                var qqcz = /[1-9][0-9]*/;
                var userqq = $(this).val();
                if (!qqcz.test(userqq)) {
                    $("#usersqq").html("<small>QQ输入格式不正确请重新输入！</small>");

                } else {
                    $("#usersqq").html("<small>QQ输入格式正确！</small>");
                }
            });
            $("#tusersEmail").blur(function () {
                var useremail = $(this).val();
                if (useremail != "") {
                    var emailcz = /([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+/;
                    if (!emailcz.test(useremail)) {
                        $("#usersEmail").html("<small>邮箱输入格式不正确请重新输入！</small>");
                    } else {
                        $("#usersEmail").html("<small>邮箱输入正确！</small>");
                    }
                } else {
                    $("#usersEmail").html("<small>邮箱不能为空！</small>");
                }
            });
            $("#tuserpwd1").blur(function () {
                var upwd1 = $(this).val();
                if (upwd1 == "") {
                    $("#userpwd1").html("<small>密码不能为空！</small>");
                }
            });
            $("#tuserpwd2").blur(function () {
                var upwd2 = $(this).val();
                var upwd1 = $("#tuserpwd1").val();
                if (upwd2 != upwd1) {
                    alert("两次输入的密码不一致,请重新输入!");
                }
            });

            $("#Usersubmit").click(function () {
                var code = $("#textCode").val();
                if (code != "") {
                    var pwd = $("#tuserpwd2").val();
                    var password = hex_md52(pwd).toUpperCase();
                    $.post("ashx/UsersHandler.ashx",
                        { parms: "Add_pmusers",
                            tuserName: $("#tuserName").val(),
                            tusersqq: $("#tusersqq").val(),
                            tusersEmail: $("#tusersEmail").val(),
                            tuserpwd: password,
                            textCode: $("#textCode").val()
                        }, function (result) {
                            if (result == "1") {
                                alert("注册成功! 请重新登录!");
                                window.location.href = "UserLogin.aspx";
                            } else if (result == "2") {
                                alert("输入的验证码错误!");
                            } else {
                                alert("服务器繁忙...请稍后!");
                            }
                        });
                } else {
                    alert("验证码不能为空!");
                }

            });
        });

        
    </script>
</body>
</html>
